package main;
import java.util.ArrayList;
import java.util.List;

import ulity.WriteXml;

import model.UserGen;
public class GenarateUser {
    public static List<UserGen>genUser(int numberUser){
    	List<UserGen> users = new ArrayList<UserGen>();
    	
    	UserGen user = new UserGen();
		user.setUserName("quan");
		user.setEmail("quan@gmail.com");
		user.setPass("1");
		users.add(user);
		
		user = new UserGen();
		user.setUserName("hoang");
		user.setEmail("quan@gmail.com");
		user.setPass("1");
		users.add(user);
		
		user = new UserGen();
		user.setUserName("giang");
		user.setEmail("quan@gmail.com");
		user.setPass("1");
		users.add(user);
		
		user = new UserGen();
		user.setUserName("a");
		user.setEmail("quan@gmail.com");
		user.setPass("1");
		users.add(user);
    	RandomString username = new RandomString(8);
    	//RandomString pass = "1";
    	//AutoUser auto = new AutoUser("", "");
    	for(int i = 0; i< numberUser;i++){
    	    user = new UserGen();
    		user.setUserName(username.nextString());
    		user.setPass("1");
    		user.setEmail("quan@gmail.com");
    		users.add(user);
    		
    		
    	}
    	
		
    	return users;
    }
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		WriteXml configFile = new WriteXml();
	    configFile.setFile("data/user2.xml");
	    try {
	      configFile.saveConfig(GenarateUser.genUser(999));
	    } catch (Exception e) {
	      e.printStackTrace();
	    }
       
	}

}
                                                                          